// Copyright (C) 2008 Taylor L. Riche <riche@cs.utexas.edu>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

#ifndef RCON_H_
#define RCON_H_

#include <string>

#include "ProcElement.h"
#include "CoreOp.h"
#include "RData.h"

namespace lagniappe
{

class CoreOp;

class RCon
{
protected:
	CoreOp * const op;
	RData * const rdata;
	// TLR: OPT
//	std::string const port;
	uint32_t const port;
	unsigned long dataSize;
public:
        // TLR: OPT
	//RCon(CoreOp * const o, RData * const r, std::string const p, unsigned long s = 0) : op(o), rdata(r), port(p), dataSize(s) {}
        RCon(CoreOp * const o, RData * const r, uint32_t const p, unsigned long s = 0) : op(o), rdata(r), port(p), dataSize(s) {assert(o != NULL);}
	RCon(const RCon & src) : op(src.op), rdata(src.rdata), port(src.port), dataSize(src.dataSize) {}
	virtual ~RCon();

	//ProcElement * schedule();

	CoreOp * getOp() const {return op;}
	RData * getRData() const {return rdata;}
	// TLR: OPT
	//const std::string & getPort() const {return port;}
	const uint32_t & getPort() const {return port;}
	unsigned long getSize() const {return dataSize;}
};

}

#endif /*RCON_H_*/
